﻿using Furion.DependencyInjection;
using SqlSugar;
using System;

namespace Admin.Core
{
    /// <summary>
    /// 数据库实体依赖基类
    /// </summary>
    /// <typeparam name="TKey">主键类型</typeparam>
    [SkipScan]
    public abstract class SugarEntity<TKey>
    {
        /// <summary>
        /// 主键Id
        /// </summary>
        [SugarColumn(IsPrimaryKey = true)]
        public virtual TKey Id { get; set; }

        /// <summary>
        /// 租户Id
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public virtual Guid? TenantId { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public virtual DateTime CreatedTime { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public virtual String CreatorId { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public virtual DateTime? UpdatedTime { get; set; }

        /// <summary>
        /// 软删除
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public virtual bool IsDeleted { get; set; }
    }
}
